package cn.ickck.law_paper_final.mapper;

import cn.ickck.law_paper_final.model.entity.Pa;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PaDAO {
    int deleteByPrimaryKey(Integer id);

    int insert(Pa record);

    int insertSelective(Pa record);

    Pa selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Pa record);

    int updateByPrimaryKey(Pa record);

    @Select("select count(*) from pa")
    int count();

    @Select("select * from pa limit #{start},#{end}")
    List<Pa> selectByPage(int start, int end);

    @Select("select * from pa where name like  CONCAT('%',#{key},'%') or `key` = #{key}")
    List<Pa> selectByKeyOrName(String key);

    @Delete("delete from pa where `key` = #{key}")
    void deleteByKey(String key);
}